<script>
    export let input;
</script>

<div class="container">
    {#each input as item}
    {#if item.type === "btn"}
        <button class="button is-primary is-fullwidth" on:click={item.click || ""}>{item.label}</button>
    {:else}
        <div class="field">
          <label class="label">{item.label}</label>
          <div class="control">
            <input class="input" type="text" placeholder="{item.placeholder || ''} " bind:value={item.val}>
          </div>
        </div>
    {/if}
    {/each}
</div>

<style>
    .container {
        width: 40vw;
        margin: 100px auto;
        border: 1px solid #ccc;
        padding: 100px;
    }
</style>
